<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('扫码枪列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    /* 数据明细 */
 function scanlist(deviceId) {
     $.modal.openTab("数据明细", '/view/scanlist?deviceId='+deviceId);
 }

$(function() {
 var options = {
     url: "/api/scan/count",
     sortName: "createTime",
     modalName: "分配扫码枪",
     columns: [{
         checkbox: true
     },
     {
         field: 'name',
         title: '姓名',
         sortable: true
     },
     {
         field: 'workNumber',
         title: '工号',
         sortable: true
     },
     {
         field: 'deviceId',
         title: '扫码枪设备id',
         sortable: true
     },
     {
         field: 'scnum',
         title: '数量',
         sortable: true
     },
     {
         title: '操作',
         align: 'center',
         formatter: function(value, row, index) {
             var actions = [];
              actions.push("<a class='btn btn-success btn-xs ' href='javascript:void(0)' onclick='scanlist(" + row.deviceId + ")'><i class='fa fa-edit'></i>明细</a>");
             return actions.join('');
         }
     }]
 };
 $.table.init(options);

});
</script>
</body>
</html>